<template>
    <div id="temp">
        <ul class="mui-table-view">
            <li v-for="item in list" :key="item.id" class="mui-table-view-cell mui-media">
                <router-link v-bind="{to:'/news/newsinfo/'+item.id}">
                    <img class="mui-media-object mui-pull-left" :src="item.img_url">
                        <div class="mui-media-body">
                            {{item.title}}
                            <p class='mui-ellipsis'>{{item.zhaiyao}}</p>
                        </div>
                    <div class="foot">
                        <span class="time">{{item.add_time |datefmt('YYYY-MM-DD HH:mm:ss')}}</span>
                        <span class="dot">点击：{{item.click}}</span>
                    </div>
                </router-link>
            </li>
        </ul>
    </div>
</template>
<script>
import common from '../../kits/common.js'
export default {
    data(){
        return {
            list:[]
        }
    },
    created(){
        this.getnewslist();
    },
    methods:{
        getnewslist(){
            var url = common.apidomain+'/api/getnewslist';
            this.$http.get(url).then(function(response){
                var data = response.body;
                console.log(data);
                // if(data.status !=0){
                // 	Toast(data.message);
                // 	return
                // }
                this.list = data.message;
            })
        }
    }

}
</script>
<style scoped>
    .mui-table-view .mui-media-object {
    line-height: 80px;
    max-width: 80px;
    height: 80px;
}
    .foot{
        margin-top:1em;
    }
    .foot .time{
        color: deepskyblue;
        font-size: 14px;
    }
    .mui-media-body{
        font-size: 16px;
    }
    .foot .dot{
        margin-left: 10px;
        color: deepskyblue;
        font-size: 14px;
    }
</style>